/* Class39_Sub5_Sub10_Sub4 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */

public class Class39_Sub5_Sub10_Sub4 extends Class39_Sub5_Sub10
{
    public int anInt2479;
    public int anInt2480;
    public int anInt2481;
    public int anInt2482;
    public int anInt2483;
    public int anInt2484;
    public int[] anIntArray2485;
    public byte[] aByteArray2486;
    
    public void method691() {
	byte[] is = new byte[anInt2480 * anInt2481];
	int i = 0;
	for (int i_0_ = 0; i_0_ < anInt2481; i_0_++) {
	    for (int i_1_ = anInt2480 - 1; i_1_ >= 0; i_1_--)
		is[i++] = aByteArray2486[i_1_ + i_0_ * anInt2480];
	}
	aByteArray2486 = is;
	anInt2484 = anInt2482 - anInt2480 - anInt2484;
    }
    
    public Class39_Sub5_Sub10_Sub4 method692() {
	Class39_Sub5_Sub10_Sub4 class39_sub5_sub10_sub4_2_
	    = new Class39_Sub5_Sub10_Sub4(anInt2480, anInt2481,
					  anIntArray2485.length);
	class39_sub5_sub10_sub4_2_.anInt2482 = anInt2482;
	class39_sub5_sub10_sub4_2_.anInt2483 = anInt2483;
	class39_sub5_sub10_sub4_2_.anInt2484 = anInt2484;
	class39_sub5_sub10_sub4_2_.anInt2479 = anInt2479;
	int i = aByteArray2486.length;
	for (int i_3_ = 0; i_3_ < i; i_3_++)
	    class39_sub5_sub10_sub4_2_.aByteArray2486[i_3_]
		= aByteArray2486[i_3_];
	i = anIntArray2485.length;
	for (int i_4_ = 0; i_4_ < i; i_4_++)
	    class39_sub5_sub10_sub4_2_.anIntArray2485[i_4_]
		= anIntArray2485[i_4_];
	return class39_sub5_sub10_sub4_2_;
    }
    
    public void method693(int i, int i_5_, int i_6_) {
	for (int i_7_ = 0; i_7_ < anIntArray2485.length; i_7_++) {
	    int i_8_ = anIntArray2485[i_7_] >> 16 & 0xff;
	    i_8_ += i;
	    if (i_8_ < 0)
		i_8_ = 0;
	    else if (i_8_ > 255)
		i_8_ = 255;
	    int i_9_ = anIntArray2485[i_7_] >> 8 & 0xff;
	    i_9_ += i_5_;
	    if (i_9_ < 0)
		i_9_ = 0;
	    else if (i_9_ > 255)
		i_9_ = 255;
	    int i_10_ = anIntArray2485[i_7_] & 0xff;
	    i_10_ += i_6_;
	    if (i_10_ < 0)
		i_10_ = 0;
	    else if (i_10_ > 255)
		i_10_ = 255;
	    anIntArray2485[i_7_] = (i_8_ << 16) + (i_9_ << 8) + i_10_;
	}
    }
    
    public void method694() {
	byte[] is = new byte[anInt2480 * anInt2481];
	int i = 0;
	for (int i_11_ = anInt2481 - 1; i_11_ >= 0; i_11_--) {
	    for (int i_12_ = 0; i_12_ < anInt2480; i_12_++)
		is[i++] = aByteArray2486[i_12_ + i_11_ * anInt2480];
	}
	aByteArray2486 = is;
	anInt2479 = anInt2483 - anInt2481 - anInt2479;
    }
    
    public void method695(int i, int i_13_) {
	i += anInt2484;
	i_13_ += anInt2479;
	int i_14_ = i + i_13_ * Class39_Sub5_Sub10.anInt1821;
	int i_15_ = 0;
	int i_16_ = anInt2481;
	int i_17_ = anInt2480;
	int i_18_ = Class39_Sub5_Sub10.anInt1821 - i_17_;
	int i_19_ = 0;
	if (i_13_ < Class39_Sub5_Sub10.anInt1820) {
	    int i_20_ = Class39_Sub5_Sub10.anInt1820 - i_13_;
	    i_16_ -= i_20_;
	    i_13_ = Class39_Sub5_Sub10.anInt1820;
	    i_15_ += i_20_ * i_17_;
	    i_14_ += i_20_ * Class39_Sub5_Sub10.anInt1821;
	}
	if (i_13_ + i_16_ > Class39_Sub5_Sub10.anInt1819)
	    i_16_ -= i_13_ + i_16_ - Class39_Sub5_Sub10.anInt1819;
	if (i < Class39_Sub5_Sub10.anInt1824) {
	    int i_21_ = Class39_Sub5_Sub10.anInt1824 - i;
	    i_17_ -= i_21_;
	    i = Class39_Sub5_Sub10.anInt1824;
	    i_15_ += i_21_;
	    i_14_ += i_21_;
	    i_19_ += i_21_;
	    i_18_ += i_21_;
	}
	if (i + i_17_ > Class39_Sub5_Sub10.anInt1823) {
	    int i_22_ = i + i_17_ - Class39_Sub5_Sub10.anInt1823;
	    i_17_ -= i_22_;
	    i_19_ += i_22_;
	    i_18_ += i_22_;
	}
	if (i_17_ > 0 && i_16_ > 0)
	    method696(Class39_Sub5_Sub10.anIntArray1818, aByteArray2486,
		      anIntArray2485, i_15_, i_14_, i_17_, i_16_, i_18_,
		      i_19_);
    }
    
    public static void method696(int[] is, byte[] is_23_, int[] is_24_, int i,
				 int i_25_, int i_26_, int i_27_, int i_28_,
				 int i_29_) {
	int i_30_ = -(i_26_ >> 2);
	i_26_ = -(i_26_ & 0x3);
	for (int i_31_ = -i_27_; i_31_ < 0; i_31_++) {
	    for (int i_32_ = i_30_; i_32_ < 0; i_32_++) {
		int i_33_ = is_23_[i++];
		if (i_33_ != 0)
		    is[i_25_++] = is_24_[i_33_ & 0xff];
		else
		    i_25_++;
		i_33_ = is_23_[i++];
		if (i_33_ != 0)
		    is[i_25_++] = is_24_[i_33_ & 0xff];
		else
		    i_25_++;
		i_33_ = is_23_[i++];
		if (i_33_ != 0)
		    is[i_25_++] = is_24_[i_33_ & 0xff];
		else
		    i_25_++;
		i_33_ = is_23_[i++];
		if (i_33_ != 0)
		    is[i_25_++] = is_24_[i_33_ & 0xff];
		else
		    i_25_++;
	    }
	    for (int i_34_ = i_26_; i_34_ < 0; i_34_++) {
		int i_35_ = is_23_[i++];
		if (i_35_ != 0)
		    is[i_25_++] = is_24_[i_35_ & 0xff];
		else
		    i_25_++;
	    }
	    i_25_ += i_28_;
	    i += i_29_;
	}
    }
    
    public void method697() {
	if (anInt2480 != anInt2482 || anInt2481 != anInt2483) {
	    byte[] is = new byte[anInt2482 * anInt2483];
	    int i = 0;
	    for (int i_36_ = 0; i_36_ < anInt2481; i_36_++) {
		for (int i_37_ = 0; i_37_ < anInt2480; i_37_++)
		    is[i_37_ + anInt2484 + (i_36_ + anInt2479) * anInt2482]
			= aByteArray2486[i++];
	    }
	    aByteArray2486 = is;
	    anInt2480 = anInt2482;
	    anInt2481 = anInt2483;
	    anInt2484 = 0;
	    anInt2479 = 0;
	}
    }
    
    public Class39_Sub5_Sub10_Sub4() {
	/* empty */
    }
    
    public Class39_Sub5_Sub10_Sub4(int i, int i_38_, int i_39_) {
	anInt2482 = anInt2480 = i;
	anInt2483 = anInt2481 = i_38_;
	anInt2484 = anInt2479 = 0;
	aByteArray2486 = new byte[i * i_38_];
	anIntArray2485 = new int[i_39_];
    }
}
